#include <bits/stdc++.h>
using namespace std;
int n;
int rec[1050];
int tag[1050];
int main()
{
    scanf("%d", &n);
    for(int i=1;i<=n;i++)rec[i]=0;
    int judge;
    for(int i=0;i<=n;i++)
    {
        rec[i]=1;
        for(int j=1;j<=n;j++)printf("%d", rec[j]);
        printf("\n");
        fflush(stdout);
        scanf("%d", &judge);
        if(judge==n)return 0;
        else if(judge==n/2)break;
    }
    tag[1]=1;
    for(int i=2;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            if(j==1||j==i)printf("%d", 1-rec[j]);
            else printf("%d", rec[j]);
        }
        printf("\n");
        fflush(stdout);
        scanf("%d", &judge);
        if(judge==n)return 0;
        else if(judge==n/2){
            tag[i]=2;
        }
        else tag[i]=1;
    }
    for(int i=1;i<=n;i++)
    {
        if(tag[i]==1)printf("%d", rec[i]);
        else printf("%d", 1-rec[i]);
    }
    printf("\n");
    fflush(stdout);
    scanf("%d", &judge);
    if(judge==n)return 0;
    for(int i=1;i<=n;i++)
    {
        if(tag[i]==2)printf("%d", rec[i]);
        else printf("%d", 1-rec[i]);
    }
    printf("\n");
    fflush(stdout);
    scanf("%d", &judge);
    if(judge==n)return 0;
}

